package com.atguigu.spring.factory;

import java.util.HashMap;
import java.util.Map;
/**
 * 实例工厂的方法，需要创建工厂实例本身
 * @author macbook
 *
 */
public class InstanceCarFactory {
     private Map<String,Car> cars = null;

	public InstanceCarFactory() {
		cars = new HashMap<String,Car>();
		cars.put("audi", new Car("audi",100000));
		cars.put("ford", new Car("ford",40000));
	}
	public Car getCar(String name){
		return cars.get(name);
	}
     
}
